/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sc.byahi.user.shared;

import java.util.ArrayList;
import java.util.List;

public class SuccessStory extends AbstractEntity<Long> {
	private static final long serialVersionUID = 1L;

	public static String APPROVED = "approved";
	public static String GROOM_ID = "groomId";
	public static String BRIDE_ID = "brideId";
	public static String TEXT = "text";

	protected Long id = null;
	private Boolean approved = Boolean.FALSE;
	private Long groomId;
	private Long brideId;
	private String text;

	@Override
	public List<String> getUnindexedPropertyNames() {
		List<String> props = new ArrayList<String>();
		props.add(APPROVED);
		props.add(TEXT);
		return props;
	}

	@Override
	public List<String> getIndexedPropertyNames() {
		List<String> props = new ArrayList<String>();
		props.add(GROOM_ID);
		props.add(BRIDE_ID);
		return props;
	}

	@Override
	public Object getProperty(String key) {
		if (APPROVED.equals(key)) {
			return isApproved();
		}
		if (GROOM_ID.equals(key)) {
			return getGroomId();
		}
		if (BRIDE_ID.equals(key)) {
			return getBrideId();
		}
		if (TEXT.equals(key)) {
			return getText();
		}
		return null;
	}

	public void setProperty(String key, Object value) {
		if (APPROVED.equals(key)) {
			setApproved((Boolean) value);
		}
		if (GROOM_ID.equals(key)) {
			setGroomId((Long) value);
		}
		if (BRIDE_ID.equals(key)) {
			setBrideId((Long) value);
		}
		if (TEXT.equals(key)) {
			setText((String) value);
		}
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getGroomId() {
		return groomId;
	}

	public void setGroomId(Long myId) {
		this.groomId = myId;
	}

	public Long getBrideId() {
		return brideId;
	}

	public void setBrideId(Long spouseId) {
		this.brideId = spouseId;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public Boolean isApproved() {
		return approved;
	}

	public void setApproved(Boolean approved) {
		if (approved != null)
			this.approved = approved;
	}

}
